package com.tamakloe.guestbook;
import java.util.Calendar;
import java.util.Date;
import java.text.ParseException;
import java.text.SimpleDateFormat;

public class DateUtils {
  public static final String DATE_FORMAT_NOW_FILE = "yyyy-MM-dd-HH-mm";
  public static final String DATE_FORMAT_NOW = "dd/MM/yyyy HH:mm:ss";
  
  public static String nowFilename() {
    Calendar cal = Calendar.getInstance();
    SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW_FILE);
    return sdf.format(cal.getTime());

  }
  public static String now() {
	    Calendar cal = Calendar.getInstance();
	    SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);
	    return sdf.format(cal.getTime());

	  }
  public static Date getDateObect(String date) throws ParseException{
	  SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);
	  return sdf.parse(date);
  }

  public static void  main(String arg[]) {
    System.out.println("Now : " + DateUtils.now());
  }
}
